package com.rahms.server.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.rahms.pojo.entity.ElderlyInfo;
import com.rahms.server.mapper.ElderlyInfoMapper;
import com.rahms.server.service.ElderlyInfoService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 老人信息服务实现类
 */
@Service
public class ElderlyInfoServiceImpl extends ServiceImpl<ElderlyInfoMapper, ElderlyInfo> implements ElderlyInfoService {
    
    @Override
    public List<ElderlyInfo> getElderlyListByUserId(Long userId) {
        LambdaQueryWrapper<ElderlyInfo> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(ElderlyInfo::getUserId, userId);
        return this.list(queryWrapper);
    }
}